 ///
 /// @file    test_dict.cpp
 /// @author  lemon(haohb13@gmail.com)
 /// @date    2016-03-25 15:17:08
 ///
 
#include "Configuration.hpp"
#include "DictProducer.hpp"
#include "SplitTool.h"
#include <iostream>
#include <string>
#include <vector>

using std::cout;
using std::endl;
using std::string;
using std::vector;

int main(void)
{
	wd::Configuration config("./conf/myconf.conf");
	auto map = config.getConfigMap();
	for(auto & elem : map)
	{
		cout << elem.first << " --> "
			 << elem.second << endl;
	}

	
	SplitTool * pTool = new SplitToolNLPIR(config);
#if 0
	vector<string> vecWords = pTool->cut("我是中国人");
	for(auto & elem : vecWords)
	{
		cout << elem << endl;
	}
#endif

#if 0
	//创建英文词典
	wd::DictProducer producer(map["yuliao"]);
	producer.show_files();
	producer.build_dict();
	producer.store_dict(map["dict"].c_str());
#endif
	//创建中文词典
	
	cout << "cn_yuliao = " << map["cn_yuliao"] << endl;
	
	wd::DictProducer producer(map["cn_yuliao"], pTool);
	producer.show_files();
	producer.build_cn_dict();
	producer.store_dict(map["cn_dict"].c_str());

	return 0;
}
